/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package amanda_gabriel_isabella_lucivania_monica.View;

import amanda_gabriel_isabella_lucivania_monica.Model.Dao.DaoBaseImpl;

/**
 * Interface gráfica do login principal
 *
 * @author lucy
 */
public class LoginIG extends javax.swing.JFrame {

    /**
     * Creates new form LoginIG
     */
    private DaoBaseImpl daoBase;

    public LoginIG(DaoBaseImpl daoBase) {
        initComponents();
        this.daoBase = daoBase;
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jPPainelUFLN = new javax.swing.JPanel();
        jBAluno = new javax.swing.JButton();
        jLRealizarLoginComo = new javax.swing.JLabel();
        jBAdministrador = new javax.swing.JButton();
        jBProfessor = new javax.swing.JButton();
        jLIconeAluno = new javax.swing.JLabel();
        jLIconeProfessor = new javax.swing.JLabel();
        jLIconeAdministrador1 = new javax.swing.JLabel();
        jLIconeAdministrador2 = new javax.swing.JLabel();
        jLIconeAdministrador3 = new javax.swing.JLabel();
        jBSair = new javax.swing.JButton();
        jSeparator1 = new javax.swing.JSeparator();
        jLabel2 = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();
        jLabel4 = new javax.swing.JLabel();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("Início");
        addWindowListener(new java.awt.event.WindowAdapter() {
            public void windowClosed(java.awt.event.WindowEvent evt) {
                formWindowClosed(evt);
            }
        });

        jPPainelUFLN.setBorder(javax.swing.BorderFactory.createTitledBorder(">> Bem-Vindo  ao Sistema  de Controle Acadêmico  da  UFLN <<"));
        jPPainelUFLN.setForeground(new java.awt.Color(231, 238, 242));
        jPPainelUFLN.setToolTipText("Exemplo");

        jBAluno.setText("Aluno");
        jBAluno.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jBAlunoActionPerformed(evt);
            }
        });

        jLRealizarLoginComo.setText("Desejo realizar Login como:");

        jBAdministrador.setText("Administrador");
        jBAdministrador.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jBAdministradorActionPerformed(evt);
            }
        });

        jBProfessor.setText("Professor");
        jBProfessor.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jBProfessorActionPerformed(evt);
            }
        });

        jLIconeAdministrador1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/amanda_gabriel_isabella_lucivania_monica/View/image3004.png"))); // NOI18N
        jLIconeAdministrador1.setMaximumSize(new java.awt.Dimension(100, 100));
        jLIconeAdministrador1.setMinimumSize(new java.awt.Dimension(100, 100));
        jLIconeAdministrador1.setPreferredSize(new java.awt.Dimension(100, 100));

        jLIconeAdministrador2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/amanda_gabriel_isabella_lucivania_monica/View/area_aluno.png"))); // NOI18N
        jLIconeAdministrador2.setMaximumSize(new java.awt.Dimension(100, 100));
        jLIconeAdministrador2.setMinimumSize(new java.awt.Dimension(100, 100));
        jLIconeAdministrador2.setPreferredSize(new java.awt.Dimension(100, 100));

        jLIconeAdministrador3.setIcon(new javax.swing.ImageIcon(getClass().getResource("/amanda_gabriel_isabella_lucivania_monica/View/admin.png"))); // NOI18N
        jLIconeAdministrador3.setMaximumSize(new java.awt.Dimension(100, 100));
        jLIconeAdministrador3.setMinimumSize(new java.awt.Dimension(100, 100));
        jLIconeAdministrador3.setPreferredSize(new java.awt.Dimension(100, 100));

        jBSair.setText("Sair");
        jBSair.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jBSairActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPPainelUFLNLayout = new javax.swing.GroupLayout(jPPainelUFLN);
        jPPainelUFLN.setLayout(jPPainelUFLNLayout);
        jPPainelUFLNLayout.setHorizontalGroup(
            jPPainelUFLNLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPPainelUFLNLayout.createSequentialGroup()
                .addGap(48, 48, 48)
                .addGroup(jPPainelUFLNLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPPainelUFLNLayout.createSequentialGroup()
                        .addGroup(jPPainelUFLNLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addGroup(jPPainelUFLNLayout.createSequentialGroup()
                                .addComponent(jLRealizarLoginComo)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                            .addGroup(jPPainelUFLNLayout.createSequentialGroup()
                                .addGap(143, 143, 143)
                                .addComponent(jLIconeAdministrador3, javax.swing.GroupLayout.PREFERRED_SIZE, 72, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 280, Short.MAX_VALUE)
                                .addComponent(jLIconeAdministrador1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(278, 278, 278)
                                .addComponent(jLIconeAdministrador2, javax.swing.GroupLayout.PREFERRED_SIZE, 84, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(48, 48, 48)))
                        .addComponent(jLIconeProfessor)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 277, Short.MAX_VALUE)
                        .addComponent(jLIconeAluno)
                        .addGap(62, 62, 62))
                    .addGroup(jPPainelUFLNLayout.createSequentialGroup()
                        .addGroup(jPPainelUFLNLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(jBSair, javax.swing.GroupLayout.PREFERRED_SIZE, 141, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGroup(jPPainelUFLNLayout.createSequentialGroup()
                                .addComponent(jBAdministrador, javax.swing.GroupLayout.PREFERRED_SIZE, 253, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(18, 18, 18)
                                .addComponent(jBProfessor, javax.swing.GroupLayout.PREFERRED_SIZE, 174, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(18, 18, 18)
                                .addComponent(jBAluno, javax.swing.GroupLayout.PREFERRED_SIZE, 352, javax.swing.GroupLayout.PREFERRED_SIZE)))
                        .addContainerGap())))
        );

        jPPainelUFLNLayout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {jBAdministrador, jBAluno, jBProfessor});

        jPPainelUFLNLayout.setVerticalGroup(
            jPPainelUFLNLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPPainelUFLNLayout.createSequentialGroup()
                .addGroup(jPPainelUFLNLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPPainelUFLNLayout.createSequentialGroup()
                        .addGap(46, 46, 46)
                        .addComponent(jLRealizarLoginComo)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 93, Short.MAX_VALUE)
                        .addGroup(jPPainelUFLNLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPPainelUFLNLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                .addComponent(jLIconeProfessor, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 87, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addComponent(jLIconeAluno, javax.swing.GroupLayout.PREFERRED_SIZE, 78, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addComponent(jLIconeAdministrador1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 87, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPPainelUFLNLayout.createSequentialGroup()
                        .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addGroup(jPPainelUFLNLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPPainelUFLNLayout.createSequentialGroup()
                                .addComponent(jLIconeAdministrador3, javax.swing.GroupLayout.PREFERRED_SIZE, 72, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(15, 15, 15))
                            .addComponent(jLIconeAdministrador2, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 72, javax.swing.GroupLayout.PREFERRED_SIZE))))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPPainelUFLNLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jBAluno)
                    .addComponent(jBAdministrador)
                    .addComponent(jBProfessor))
                .addGap(145, 145, 145)
                .addComponent(jBSair)
                .addContainerGap())
        );

        jLabel2.setFont(new java.awt.Font("Ubuntu", 0, 10)); // NOI18N
        jLabel2.setText("Desenvolvido por Amanda, Gabriel, Isabella, Lucivânia e Mônica");

        jLabel3.setFont(new java.awt.Font("Ubuntu", 0, 10)); // NOI18N
        jLabel3.setText("Discentes - Ciência da Computação - UFSJ");

        jLabel4.setFont(new java.awt.Font("Ubuntu", 0, 10)); // NOI18N
        jLabel4.setText("Copyright © 2013. Todos os direitos reservados.");

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jSeparator1, javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(layout.createSequentialGroup()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(layout.createSequentialGroup()
                                .addGap(506, 506, 506)
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER)
                                    .addComponent(jLabel2)
                                    .addComponent(jLabel3)
                                    .addComponent(jLabel4)))
                            .addGroup(layout.createSequentialGroup()
                                .addContainerGap()
                                .addComponent(jPPainelUFLN, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                        .addGap(0, 0, Short.MAX_VALUE)))
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGap(27, 27, 27)
                .addComponent(jPPainelUFLN, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 29, Short.MAX_VALUE)
                .addComponent(jSeparator1, javax.swing.GroupLayout.PREFERRED_SIZE, 10, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jLabel2)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jLabel3)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jLabel4)
                .addGap(6, 6, 6))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void jBProfessorActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBProfessorActionPerformed
        LoginProfessorIG tela = new LoginProfessorIG(this, daoBase);
        setVisible(false);
        tela.setVisible(true);
    }//GEN-LAST:event_jBProfessorActionPerformed

    private void jBAdministradorActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBAdministradorActionPerformed
        LoginAdministradorIG tela = new LoginAdministradorIG(this, daoBase);
        setVisible(false);
        tela.setVisible(true);
    }//GEN-LAST:event_jBAdministradorActionPerformed

    private void jBAlunoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBAlunoActionPerformed
        LoginAlunoIG tela = new LoginAlunoIG(this, daoBase);
        setVisible(false);
        tela.setVisible(true);
    }//GEN-LAST:event_jBAlunoActionPerformed

    private void jBSairActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBSairActionPerformed
        System.exit(1);
    }//GEN-LAST:event_jBSairActionPerformed

    private void formWindowClosed(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowClosed
    }//GEN-LAST:event_formWindowClosed
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton jBAdministrador;
    private javax.swing.JButton jBAluno;
    private javax.swing.JButton jBProfessor;
    private javax.swing.JButton jBSair;
    private javax.swing.JLabel jLIconeAdministrador1;
    private javax.swing.JLabel jLIconeAdministrador2;
    private javax.swing.JLabel jLIconeAdministrador3;
    private javax.swing.JLabel jLIconeAluno;
    private javax.swing.JLabel jLIconeProfessor;
    private javax.swing.JLabel jLRealizarLoginComo;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JPanel jPPainelUFLN;
    private javax.swing.JSeparator jSeparator1;
    // End of variables declaration//GEN-END:variables
}
